/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.misena.praxispraktik.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author TADSI12
 */
@Entity
@Table(name = "personas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Personas.findAll", query = "SELECT p FROM Personas p"),
    @NamedQuery(name = "Personas.findByIdPersonas", query = "SELECT p FROM Personas p WHERE p.idPersonas = :idPersonas"),
    @NamedQuery(name = "Personas.findByTipoid", query = "SELECT p FROM Personas p WHERE p.tipoid = :tipoid"),
    @NamedQuery(name = "Personas.findByNumdoc", query = "SELECT p FROM Personas p WHERE p.numdoc = :numdoc"),
    @NamedQuery(name = "Personas.findByNombres", query = "SELECT p FROM Personas p WHERE p.nombres = :nombres"),
    @NamedQuery(name = "Personas.findByApellidos", query = "SELECT p FROM Personas p WHERE p.apellidos = :apellidos"),
    @NamedQuery(name = "Personas.findByTelefonoFijo", query = "SELECT p FROM Personas p WHERE p.telefonoFijo = :telefonoFijo"),
    @NamedQuery(name = "Personas.findByCelular", query = "SELECT p FROM Personas p WHERE p.celular = :celular"),
    @NamedQuery(name = "Personas.findByCorreo", query = "SELECT p FROM Personas p WHERE p.correo = :correo"),
    @NamedQuery(name = "Personas.findByDireccion", query = "SELECT p FROM Personas p WHERE p.direccion = :direccion")})
public class Personas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idPersonas")
    private Integer idPersonas;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "tipoid")
    private String tipoid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "numdoc")
    private String numdoc;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "nombres")
    private String nombres;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "apellidos")
    private String apellidos;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "telefonoFijo")
    private String telefonoFijo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "celular")
    private String celular;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "correo")
    private String correo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "direccion")
    private String direccion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPersonas")
    private Collection<Empresarios> empresariosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPersonas")
    private Collection<Jefes> jefesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPersonas")
    private Collection<Instructores> instructoresCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPersonas")
    private Collection<Aprendices> aprendicesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPersonas")
    private Collection<Usuarios> usuariosCollection;

    public Personas() {
    }

    public Personas(Integer idPersonas) {
        this.idPersonas = idPersonas;
    }

    public Personas(Integer idPersonas, String tipoid, String numdoc, String nombres, String apellidos, String telefonoFijo, String celular, String correo, String direccion) {
        this.idPersonas = idPersonas;
        this.tipoid = tipoid;
        this.numdoc = numdoc;
        this.nombres = nombres;
        this.apellidos = apellidos;
        this.telefonoFijo = telefonoFijo;
        this.celular = celular;
        this.correo = correo;
        this.direccion = direccion;
    }

    public Integer getIdPersonas() {
        return idPersonas;
    }

    public void setIdPersonas(Integer idPersonas) {
        this.idPersonas = idPersonas;
    }

    public String getTipoid() {
        return tipoid;
    }

    public void setTipoid(String tipoid) {
        this.tipoid = tipoid;
    }

    public String getNumdoc() {
        return numdoc;
    }

    public void setNumdoc(String numdoc) {
        this.numdoc = numdoc;
    }

    public String getNombres() {
        return nombres;
    }

    public void setNombres(String nombres) {
        this.nombres = nombres;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public String getTelefonoFijo() {
        return telefonoFijo;
    }

    public void setTelefonoFijo(String telefonoFijo) {
        this.telefonoFijo = telefonoFijo;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getCorreo() {
        return correo;
    }

    public void setCorreo(String correo) {
        this.correo = correo;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    @XmlTransient
    public Collection<Empresarios> getEmpresariosCollection() {
        return empresariosCollection;
    }

    public void setEmpresariosCollection(Collection<Empresarios> empresariosCollection) {
        this.empresariosCollection = empresariosCollection;
    }

    @XmlTransient
    public Collection<Jefes> getJefesCollection() {
        return jefesCollection;
    }

    public void setJefesCollection(Collection<Jefes> jefesCollection) {
        this.jefesCollection = jefesCollection;
    }

    @XmlTransient
    public Collection<Instructores> getInstructoresCollection() {
        return instructoresCollection;
    }

    public void setInstructoresCollection(Collection<Instructores> instructoresCollection) {
        this.instructoresCollection = instructoresCollection;
    }

    @XmlTransient
    public Collection<Aprendices> getAprendicesCollection() {
        return aprendicesCollection;
    }

    public void setAprendicesCollection(Collection<Aprendices> aprendicesCollection) {
        this.aprendicesCollection = aprendicesCollection;
    }

    @XmlTransient
    public Collection<Usuarios> getUsuariosCollection() {
        return usuariosCollection;
    }

    public void setUsuariosCollection(Collection<Usuarios> usuariosCollection) {
        this.usuariosCollection = usuariosCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPersonas != null ? idPersonas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Personas)) {
            return false;
        }
        Personas other = (Personas) object;
        if ((this.idPersonas == null && other.idPersonas != null) || (this.idPersonas != null && !this.idPersonas.equals(other.idPersonas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.misena.praxispraktik.entity.Personas[ idPersonas=" + idPersonas + " ]";
    }
    
}
